package com.dingwen.treasure.kettle.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dingwen.treasure.kettle.enums.ExecuteResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 任务执行日志
 * @author dingwen
 */
@TableName(value ="task_log")
@ApiModel(value = "TaskLog", description = "任务执行日志")
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class TaskLog implements Serializable {
    @TableField(exist = false)
    private static final long serialVersionUID = 5439598434710245981L;

    /**
     * 主键
     */
    @TableId(value = "log_id",type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = " 主键")
    private Long logId;

    /**
     * 任务ID
     */
    @TableField(value = "task_id")
    @ApiModelProperty(value = " 任务ID")
    private Long taskId;

    /**
     * 激活时间
     */
    @TableField(value = "activate_time")
    @ApiModelProperty(value = " 激活时间")
    private LocalDateTime activateTime;

    /**
     * 耗时
     */
    @TableField(value = "consumer_time")
    @ApiModelProperty(value = " 耗时")
    private Long consumerTime;

    /**
     * 执行结果：
        1： 成功
        0： 失败
     */
    @TableField(value = "execute_result")
    @ApiModelProperty(value = " 执行结果")
    private ExecuteResultEnum executeResult;

    /**
     * 备注
     */
    @TableField(value = "remark")
    @ApiModelProperty(value = " 备注")
    private String remark;
}